
cc.Class({
    extends: cc.Component,

    properties: {
        headSprite:cc.Node,
        nameLabel:cc.Label,
        descLabel:cc.Label,
        moneyMessageDic:""


    },

    withdrawClick:function(){
 
        if(this.moneyMessageDic["money_value"]<this.moneyMessageDic["give_money"]){

            console.log("提现不足")
            var mainNode= cc.find("Canvas/MainCamera/moneyFaileAlertView")
            mainNode.active=true
    
            var nameLabelNode= cc.find("Canvas/MainCamera/moneyFaileAlertView/endSprites/nameLabel")
            nameLabelNode.getComponent(cc.Label).string=this.moneyMessageDic["tip_msg"]

        }else{

            var phoneNode= cc.find("Canvas/MainCamera/moneyPhoneView")
            phoneNode.active=true

        }
    },

    // onLoad () {},

    start () {

    },

    init(moneyDic){

        this.moneyMessageDic=moneyDic
        this.nameLabel.getComponent(cc.Label).string=moneyDic["name"]
        this.descLabel.getComponent(cc.Label).string=moneyDic["des"]
        var that = this     
        cc.loader.load({url: moneyDic["thumbnail"], type: 'png'}, function(err,img){
            var mylogo  = new cc.SpriteFrame(img); 
            that.headSprite.getComponent(cc.Sprite).spriteFrame = mylogo;
            that.headSprite.width=106
            that.headSprite.height=106
        });
    }
    // update (dt) {},
});
